#include "vertex_prim_out.h"

RRVertexPrim::RRVertexPrim()
{
  verts_index = 0;
  for(int i=0; i<4; i++)
    c[i] = 0.0;
}

void RRVertexPrim::rrBegin(RRPrimitiveType type)
{
  t = type;
  verts_index = 0;
}

void RRVertexPrim::rrEnd(){}

void RRVertexPrim::rrSetVert2f(float x, float y)
{
  verts[verts_index].x = x;
  verts[verts_index].y = y;
  for(int i=0; i<4; i++)
    verts[verts_index].color[i] = c[i];
  verts_index += 1;
}

void RRVertexPrim::rrColor4f(float a, float r, float g, float b)
{
  c[0] = a;
  c[1] = r;
  c[2] = g;
  c[3] = b;
}

RRVertexPoint RRVertexPrim::rrGetPoint(int index)
{
  return verts[index];
}

RRPrimitiveType RRVertexPrim::rrGetType()
{
  return t;
}

int RRVertexPrim::rrGetVertsNum()
{
  return verts_index;
}
